import api from '@/libs/request'

import { type IcOrder, type IcOrderPageParams } from './types'

/**
 * 分页查询商家配送单
 */
export const doGetIcOrderList = (data: IcOrderPageParams) => {
    return api.post<L<IcOrder>>(`addon-ic/ic/shop/order/page`, data)
}
/**
 * 店员接单
 */
export const doTakeIcOrder = (orderNo: IcOrder['orderNo']) => {
    return api.post(`addon-ic/ic/shop/order/take`, { orderNo })
}
/**
 * 店员取消接单
 */
export const doCancelTakeIcOrder = (orderNo: IcOrder['orderNo']) => {
    return api.post(`addon-ic/ic/shop/order/offer`, { orderNo })
}
/**
 * 订单更新为下个状态
 */
export const doUpdateOrderNextStatus = (orderNo: IcOrder['orderNo']) => {
    return api.post(`addon-ic/ic/shop/order/status/next`, { orderNo })
}
